package controller;

import java.io.IOException;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import service.Link;

@SuppressWarnings("serial")
public class SearchServlet extends HttpServlet {
	public void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws IOException {
		resp.setContentType("text/plain");
		
		String name = req.getParameter("name");
		if(name!=null)
		{
			resp.sendRedirect("/gsearch?cx="+Link.getCx()+"&cof=FORID%3A10&ie=UTF-8&q="+name+"&sa=Search");
		}
	}
}
